package org.example.demo2_lishi.one;

public class RectangleDemo {
    public static void main(String[] args) {
         //创建长方形对象
        Rectangle r = new Rectangle();
        r.setLength(10);
        r.setWidth(6);
        r.getArea();
        r.getPerimeter();

        System.out.println("----------------");

        //创建正方形对象
        Square square = new Square();
        square.setSide(7);
        square.getArea();
        square.getPerimeter();

    }
}
